package com.car.carmgr.mapper;

import com.car.carmgr.bean.Car;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface CarMapper {

    int insertCar(Car car);

    int deleteCarById(String carId);

    int updateCar(Car car);

    int findCarById(@Param("carNumber") String carNumber);

    /**
     * 查询用户
     */
    List<Car> findCarByWhere(@Param("carNumber") String carNumber, @Param("carType") String carType, @Param("color") String color, @Param("price") Double price, @Param("rentPrice") Double rentPrice, @Param("deposit") Double deposit, @Param("isRenting") Integer isRenting, @Param("description") String description, @Param("carImg") String carImg,@Param("createTime") Date createTime);

    Integer getCountByWhere(@Param("carNumber") String carNumber, @Param("carType") String carType, @Param("color") String color, @Param("price") Double price, @Param("rentPrice") Double rentPrice, @Param("deposit") Double deposit,@Param("isRenting") Integer isRenting,@Param("description") String description, @Param("carImg") String carImg,@Param("createTime") Date createTime);

    int updateCarStatus(@Param("carNumber") String carNumber,@Param("status") String status);

    List<Car> findAll();

    Integer getCount();
}
